from utils import FlinkBatchPusher, Agent, Model, ModelType
from fastapi import FastAPI
import uvicorn
import os
from dotenv import load_dotenv

load_dotenv()
api_key = os.getenv("DEEPSEEK_API_KEY")
flink = FlinkBatchPusher("localhost:9092", "video")
app = FastAPI()


@app.get("/memory")
async def memory_data(people:int):
    agent.generate(f"当前画面有{people}个人")












if __name__ == "__main__":
    # 获取apiKey，如果有则使用HTTP模式，否则使用LOCAL模式
    if api_key is not None:
        model_type = ModelType.HTTP
    else:
        model_type = ModelType.LOCAL

    model = Model(model_type, "", "")
    agent = Agent(model,[], "", "", "" )
    uvicorn.run(app, host="0.0.0.0", port=30000, reload=True)
